Repository navigation
Guard active parent builders and reattach slots in Executor Step 2a - #12316
lwwmanning wants to merge 4 commits into
Conversation
Skip Step 2a (stack_execute_parent) in ArrayRef::execute_until when the suspended parent frame has an active parent_builder, matching Step 1b so parent kernels do not rewrite partially consumed builder state. When Step 2a probes registered execute-parent kernels, temporarily reattach the focused child into the suspended parent slot before calling the kernel and detach it again if all kernels decline, ensuring parent kernels never observe a None slot hole. Update StackParentKernel in the trace test harness, which previously relied on the detached None slot to distinguish Step 2a from Step 2b, and add regression tests for both invariants. Signed-off-by: Will Manning <will@willmanning.io>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merging this PR will degrade performance by 5.29%Warning vortex-data has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed. 1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Signed-off-by: Will Manning <will@spiraldb.com> Co-Authored-By: Will Manning <will@spiraldb.com>
Signed-off-by: Will Manning <will@spiraldb.com> Co-Authored-By: Will Manning <will@spiraldb.com>
lwwmanning
left a comment
There was a problem hiding this comment.
Posted by Claude Opus 5.5 on Will's behalf.
CodSpeed reports three patched benchmarks in vortex-array/benches/probe.rs as 10% to 13% slower: repeated[patched], once[patched] and patched_same_lane_once. The other five PRs opened at the same time do not show this. This PR changes the executor loop, so I don't think it is noise.
My guess is the new Step 2a path. When a kernel exists for the parent and child pair, each iteration pops the frame and puts the child back into the parent. If the kernel declines, it takes the child out again. If something else holds the parent, the put may also copy it. A patched array whose parent kernel declines would pay this on every step. Could you profile one of these benchmarks to confirm the cause before this merges?
|
Checked
|
lwwmanning
left a comment
There was a problem hiding this comment.
Review by Gemini 4 Carbon on behalf of @lwwmanning.
The Step 2a changes in vortex-array/src/executor/mod.rs are right and bring stack_execute_parent into parity with Steps 1b and 2b. Three cleanups before merging:
- Remove the inaccurate CodSpeed regression claim from the PR description:
- The PR description states: "On CodSpeed, three
probebenchmarks on patched arrays are 10% to 13% slower, possibly because of the slot reattach."probe.rsnever entersexecute_until(and PR #12099 hit the identical241.8 / 187.4 / 226.5 µsnumbers without touchingexecutor, confirming Cachegrind I-cache layout noise). Since PR descriptions become the squash commit message, please remove that sentence.
- The PR description states: "On CodSpeed, three
- Collapse the 495 lines of mock
VTableboilerplate invortex-array/src/executor/tests.rs:- Defining four separate custom
VTables (StepChild,ReadyChild,BuilderParent,SlotInspectParent) plusUnitArrayData(duplicatingcrate::array::EmptyArrayData) is ~330 lines more boilerplate than these two tests need:- Use a single
TestChild(TestValuesData { values: PrimitiveArray }): inForbiddenBuilderParentKernel, returnOk(None)whileparent.slots()[0].is_some()(declining Step 2b beforeAppendChild(0)runs, so any call withparent.slots()[0].is_none()proves Step 2a fired with an activeparent_builder); inInspectSlotParentKernel, useseen_once: AtomicBool(matchingStackParentKernelinvortex-array/src/test_harness/trace/tests.rs) so it declines Step 2b once, suspends viaExecuteSlot, and runs in Step 2a. - Merge
BuilderParentandSlotInspectParentinto a singleTestParentVTablebacked bycrate::array::EmptyArrayData(ValidityVTableFromChildreadingarray.slots().last()): with 1 slot ([Some(child)]), execute slot 0 viaExecuteSlot(0)without a builder; with 2 slots ([Some(first), Some(second)]),AppendChild(0)->ExecuteSlot(1)->AppendChild(1).
- Use a single
- Defining four separate custom
- Update stale comment in
vortex-array/src/arrays/runend/rules.rs:- Update line 113 (
// During execution the current child can be detached from its parent.) insupports_run_values, since Step 2a now reattaches the active child slot before invokingExecuteParentKernels.
- Update line 113 (
Signed-off-by: Will Manning <will@spiraldb.com> Co-Authored-By: Will Manning <will@spiraldb.com>
|
Addressed all three items in
|
This fixes Step 2a of the iterative executor (
ArrayRef::execute_untilinvortex-array), where execute-parent kernels run against the parent thatExecuteSlotsuspended. Steps 1b and 2b are unchanged.On develop, Step 2a checks only whether the current array has an active builder. It ignores a builder that the suspended parent left in its frame. A parent rewrite can then lose or duplicate data that
AppendChildalready appended. Step 2a also gives kernels the parent with the child slot still detached (None), and a rewrite does not inherit the parent's statistics.With this PR, Step 2a also skips when the suspended frame has a
parent_builder. If the session has a kernel for the parent and child encodings, Step 2a puts the child back into its slot first. If they all decline, it detaches the child again, as Step 1b does. A rewrite now inherits the parent's statistics, as in Steps 1b and 2b.The PR also turns
executor.rsintoexecutor/mod.rs, moves the existing executor tests intoexecutor/tests.rs, and adds two regression tests there. The test kernel in the trace harness now asserts that the slot is attached, and the execution guide indocs/describes the new Step 2a.Assisted by Antigravity.